<?php
@session_start();
 $con = mysqli_connect("127.0.0.1","root","","posts");

 $comment = $_POST['comment'];
 $postid = $_POST['postid'];
 $name = $_SESSION['user'];
 
 
 mysqli_query($con,"INSERT INTO comment ( postid, name,comment)
            VALUES ( '$postid', '$name','$comment')");
 
 
 mysqli_close($con);
 
 echo "<script>window.location='../html/posts.html'</script>";
?>